home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / UNIXLIB37B.SPK / !UnixLib37 / Docs / ReadMe36d < prev    next >
Text File  |  1995-07-04  |  5KB  |  174 lines

  1. This is a rough, partial guide to what I have changed / improved / corrected
  2. in UnixLib3.6c to get it to work for GCC / G++
  3.  
  4. Thanks go to the various people who have supplied various bug-fixes,
  5. especially Alun Jones, even if he does report problems, just after I make
  6. changes that make it harder to locate the bugs.
  7.  
  8. Please note that ReadMe36c is slightly out of date, and you should ignore
  9. references to the !Boot and !alias files.
  10.  
  11. Installation for GCC
  12. ====================
  13.  
  14. For GCC to work with Unixlib, two variable need to be set up. These are
  15. Unix$path amd UnixFS$/tmp. Unix$Path shpuld point to the clib directory,
  16. with a trailing dot. UnixFS$/tmp should point to your scrap directory. This
  17. can be done by putting similar to to the following lines into your boot
  18. sequence.
  19.  
  20. *set Unix$Path ADFS::IDEDisc4.$.Usr.Develop.UnixLib36d.clib.
  21. *set UnixFS$/tmp <Wimp$ScrapDir>
  22.  
  23. gcc changes
  24. ===========
  25.  
  26. All header files have had appropriate checks for C/C++ compilation, so that
  27. C function names are not mangled when compiling C++ sources.
  28.  
  29. Number of atexit functions that can be registered has been increased to 33,
  30. so that global C++ destructors can be called
  31.  
  32. Allow for command lines of upto 1K bytes in length, as gcc can generate
  33. command lines of greater than 255 bytes.
  34.  
  35. Increase size of print buffers to 4K, as otherwise the c code generators
  36. dont generate correct code.
  37.  
  38. __uname(): for ncc compatability, we need to truncate filename of greater
  39. than 10 characters, rather than dropping vowels.
  40.  
  41. Add startup code so that C++ global constructors are called at program
  42. startup.
  43.  
  44. Incompatibilities between what GCC expects the type of error variables, and
  45. what UnixLib declares them as.
  46.  
  47. Bugs
  48. ====
  49.  
  50. If SIGSTAK is raised, an infinite loop is entered, as signal checks the
  51. stack and raises a SIGSTAK signal. Also the stack backtrace is improved
  52.  
  53. strncmp(): zero length strings were treated as 1 byte long.
  54.  
  55. memcmp(): problems with identical blocks of memory not being properly
  56. compared.
  57.  
  58. strchr(): could not find '\0' in a string.
  59.  
  60. __tmpnam(): bug that resulted in general corruption
  61.  
  62. getcwd(): corrupted the PSD. Also uses OS_Args 7 and Prefix$Dir if they can
  63. be used.
  64.  
  65. dirent(): now works with more than one open directory
  66.  
  67. stat(): Now works for Image directories.
  68.  
  69. _wr#chk functions have the wrong start address for checking the address.
  70.  
  71. If Unix$tty is set, UnixLib corrupts the heap, by trying to free part of the
  72. code!
  73.  
  74. General
  75. =======
  76.  
  77. To aid debuging, the assembler routines have had their names embeded in the
  78. code.
  79.  
  80. DRLink
  81. ======
  82.  
  83. There is a bug in DRLink that results in the offset of the entry point to be
  84. ignored, so I have moved the entry code to the start of the AREA.
  85.  
  86. Header files
  87. ============
  88.  
  89. All files have had appropriate 'extern "C"' statements added to prevent the
  90. C++ compiler mangling function names.
  91.  
  92. Minor problem of include files using include "" rather than <>.
  93.  
  94. alloca.h: GCC insists on using its own, internal version of alloca() if it
  95. can. This does not work under RISC-OS, therefore I have arrenged that GCC
  96. wont recognise alloca().
  97.  
  98. assert.h: Minor problem with K&R and ANSI C preprocesor.
  99.  
  100. dirent.h: 'struct direct' renamed to 'struct dirent'
  101.  
  102. errno.h: sys_nerr changed from 'const int' to 'int' - due to
  103. incompatabilities with GCC declaration. errno changed to __errno and errno
  104. #defined as __errno.
  105.  
  106. pwd.h: removed non STDC declarations of some functions.
  107.  
  108. stdarg.h: ensure that varargs.h / stdargs.h don't clash.
  109.  
  110. stdio.h: increase size of output buffer from 1K to 4K
  111.  
  112. stdlib.h: increase maximum number of atexit function that can be registered,
  113. as C++ needs one.
  114.  
  115. termcap.h: remove non-ANSI declarations.
  116.  
  117. unistd.h: added bits for preventing __uname() for packing filenames
  118.  
  119. sys/fcntl.h include fcntl.h
  120.  
  121. sys/file.h: GCC insists on including this.
  122.  
  123. sys/param.h: bits for DDE command line.
  124.  
  125. sys/syslib.h: bits for C++ startup code.
  126.  
  127. sys.tty.h: include termio.h if not included.
  128.  
  129. -----------------------------------------------------------------------------
  130.  
  131. Makefile: obvious
  132.  
  133. -----------------------------------------------------------------------------
  134.  
  135. src.c.atexit: changes to allow 33 atexit() functions.
  136.  
  137. src.c.memcmp: correct bug in memcmp()
  138.  
  139. src.c.strcmp(): correct bug in strncmp(), which prevents 0 length strings
  140. comparing correctly.
  141.  
  142. stdio.c.print: increase print buffer to 4K.
  143.  
  144. stdio.c.debug: add bit to shut up cc.
  145.  
  146. sys.c.errlist: change sys_nerr from 'const int' to 'int'
  147.  
  148. sys.c.exec: add code to use DDE utils if needed.
  149.  
  150. sys.c.signal: turn off stack checking, as otherwise a SIGSTAK causes an
  151. infinite loop. Improve stack backtrace.
  152.  
  153. sys.c.sysclib: C++ initialisation code. Also set __uname() non-pack facility.
  154.  
  155. sys.c.vfork: code for DDE commandline.
  156.  
  157. Assembler code: add debuging info - routine names to all assembler sources.
  158.  
  159. src.sys.s._signal: rename errno to __errno
  160.  
  161. src.sys.s.__syslib: Move entry code to start of AREA, as drlink ignores the
  162. offset value specified in the ENTRYPOINT field. add point to base of r/w
  163. area. Set up dont pack indicator for __uname(). add bits for C++
  164. constructors. Change _wr#chk to correctly check start address. set up
  165. __rwbase for write checking.
  166.  
  167. src.unix.c.dirent: rename struct direct to struct dirent.
  168.  
  169. src.unix.c.getcwd / getwd: function getwd() changed to getcwd(), which seems correct.
  170.  
  171. src.unix.c.uname: if file name is > 10 chars, dont pack if requested.
  172.  
  173. src.unix.c.unix: use DDE utils if required. Correct bug that corrupts heap
  174. if Unix$tty is set.